<template>
	<view class="container">
		<view class="titleImg">
			<img :src="baseUrl + titleImg" alt="" />
		</view>

		<view class="goods-list">
			<view v-for="(goods, i) in list" :key="i">
				<my-goods :goods="goods"></my-goods>
			</view>
		</view>
		<view class="footer">
			<view class="footer-left">
				<radio :checked="false" @click=""></radio>
				<text>全选</text>
			</view>
			<view class="footer-right">
				<button>提交订单</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				titleImg: "",
				baseUrl: uni.$http.baseUrl
			};

		},
		onLoad() {
			this.getList()
		},
		methods: {
			async getList() {
				const res = await uni.$http.post('/api/index/index', {
					token: 'a2c1c603-91d3-4442-b581-a860adbdc7a0'
				})
				this.list = res.data.data[0]
				this.titleImg = res.data.data[res.data.data.length-1][0].value
			},

			// async login(){
			// 	const params = {
			// 		account: '17837365837',
			// 		password: 'a123456',
			// 		js_code: '0e1VHQll2MTbqd4lYPol2N8C9F3VHQlj'
			// 	}
			// 	const res = await uni.$http.post('/api/user/login', params)
			// 	console.log("res login~~", res)
			// }
		},
	}
</script>

<style lang="scss">
	.container{
		background-color: #F5F7FB ;
		
	}
	.titleImg img{
		width: 686rpx;
		height: 140rpx;
		margin-left: 32rpx;
		margin-bottom: 24rpx;
		border-radius:24rpx 24rpx 24rpx 24rpx;
	}
	.footer{
		position: sticky;
		bottom: 0;
		z-index: 999;
		height: 134rpx;
		background-color: #fff;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding:27rpx 32rpx 27rpx 31rpx ;
		.footer-right{
			width: 220rpx;
			height: 80rpx;
			button{
			background: linear-gradient( 90deg, #FF880C 0%, #FF5200 100%);
			border-radius: 45rpx;
			color: #fff;
			}
		}
		.footer-left{
			text{
				color: #B7BDC4 ;
			}
		}
	}
</style>